package avicit.bdp.dds.api.dto.lineage;

import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.collections4.CollectionUtils;

import java.util.List;

/**
 * 血缘表对象
 */
public class LineageTableDto {

    @ApiModelProperty(value = "表id")
    private String id;

    @ApiModelProperty(value = "表名称")
    private String name;

    @ApiModelProperty(value = "表后可展开")
    private boolean back;

    @ApiModelProperty(value = "表前可展开")
    private boolean front;

    @ApiModelProperty(value = "x坐标")
    private int x;

    @ApiModelProperty(value = "y坐标")
    private int y;

    @ApiModelProperty(value = "层级")
    private int level;

    @ApiModelProperty(value = "高度")
    private int height;

    @ApiModelProperty(value = "下级最大高度")
    private int nextLevelMaxHeight;

    @ApiModelProperty(value = "字段数据")
    private List<LineageFieldDto> columns;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isBack() {
        return back;
    }

    public void setBack(boolean back) {
        this.back = back;
    }

    public boolean isFront() {
        return front;
    }

    public void setFront(boolean front) {
        this.front = front;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public List<LineageFieldDto> getColumns() {
        return columns;
    }

    public void setColumns(List<LineageFieldDto> columns) {
        this.columns = columns;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public int getNextLevelMaxHeight() {
        return nextLevelMaxHeight;
    }

    public void setNextLevelMaxHeight(int nextLevelMaxHeight) {
        this.nextLevelMaxHeight = nextLevelMaxHeight;
    }

    public int getColumnSize() {
        if (CollectionUtils.isNotEmpty(columns)) {
            return columns.size();
        }
        return 0;
    }

}
